package cn.smxy.ln.service;

import cn.smxy.ln.common.lang.Result;
import cn.smxy.ln.pojo.WorkProve;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;

/*
 * @author ln
 * @date 2022-05-20 19:26
 *
 */
@FeignClient(value = "TPA-SPRINGCLOUD-PROVIDER-WORKREGISTER-8010", contextId = "WorkProveService", fallbackFactory = WorkProveServiceFallbackFactory.class)
public interface WorkProveService {

    @GetMapping("/workprove/list")
    public Result queryById(@RequestParam(value = "projectId", required = false) Long projectId, @RequestParam(value = "workId", required = false) Long workId, @RequestParam(value = "userId", required = false) Long userId, @RequestParam(value = "startTime", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime, @RequestParam(value = "endTime", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd")  Date endTime, @RequestParam(value = "createTime", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd")  Date createTime);

    @PostMapping("/workprove/save")
    public Result save(@RequestBody WorkProve workProve);

    @PostMapping("/workprove/delete")
    public Result delete(@RequestParam(value = "id") Long id);

    @PostMapping("/workprove/update")
    public Result update(@RequestBody WorkProve workProve);
}
